  ##################################################################################
  # VLAN stream commands.
  # Test sets up a single stream of type IPVLAN, then sends and captures a burst
  #
  # Changed in ver 0.2 to add second string for 3101 cards (different versions of
  # 3101 return different ID strings resulting in a spurrious warning.  Changed
  # Hub Slot Port of second card from 0 1 0 to 0 0 1 to allow running on a single
  # 3101 blade.
  ##################################################################################
  
  # First two slots
  set iHub 0
  set iSlot 0
  set iPort 0
  
  set iHub2 0
  set iSlot2 0
  set iPort2 1
  
  # test will display warning if target is not one of these cards
  set testedCards {LAN-3101A LAN-6101A/3101A}
  set libVersion 3.12
  
  ###############################################################################
  #
  ###############################################################################
  proc 1VLAN {H S P {dataLength 100} } {
  
     ###########################################################
     # Set up one IP VLAN stream with L3_DEFINE_IP_STREAM_VLAN
     ###########################################################
  struct_new streamIPVLAN StreamIPVLAN
  
          set streamIPVLAN(ucActive) 1
          set streamIPVLAN(ucProtocolType) $::STREAM_PROTOCOL_IP_VLAN
          set streamIPVLAN(uiFrameLength) $dataLength
          set streamIPVLAN(ucTagField) 1 
          set streamIPVLAN(DestinationMAC)  {0x00 0x00 0x00 0x02 0x22 0x02} 
          set streamIPVLAN(SourceMAC) {0x00 0x00 0x00 0x01 0x11 0x01} 
          set streamIPVLAN(TimeToLive) 64
          set streamIPVLAN(DestinationIP) {225 0 0 1}
          set streamIPVLAN(SourceIP) {192 148 100 10}
          set streamIPVLAN(Netmask) {255 255 255 0}
          set streamIPVLAN(Gateway) {192 148 100 1}
          set streamIPVLAN(Protocol) 4 
       set streamIPVLAN(ulARPGap) 1000
       # VLAN Parameters
       set streamIPVLAN(VLAN_Pri) 0
       set streamIPVLAN(VLAN_Cfi) 0
       set streamIPVLAN(VLAN_Vid) 1     
  
  #####################################
  # set to card at $iHub $iSlot $iPort#
  #####################################
  LIBCMD HTSetStructure $::L3_DEFINE_IP_STREAM_VLAN 0 0 0 streamIPVLAN 0 $H $S $P
  }
  
  ##################################################################
  
  
  #########################################################################
  #########################        MAIN        ############################
  #########################################################################
  
  # Check for library load - is __SMARTLIB_TCL__ variable set???
  if {[info exists __SMARTLIB_TCL__] < 1} {
     # If not, look for it locally and try to load  
     if {[file exists smartlib.tcl] > 0} {
        source smartlib.tcl
     # Not loaded and not local - display message and exit
     } else {
     puts "SmartLibrary not loaded - source smartlib.tcl before starting program"
     gets stdin response
     exit
     }
  }
  # Program also requires utility.tcl
  if {[info exists __UTILITY_TCL__] < 1 } {
     if {[file exists utility.tcl] > 0} {
        source utility.tcl
     } else {
        puts "utility.tcl which was included with this progam must be also be loaded to run"
        puts "Check original zip archive and install utility.tcl in the local directory before running"
        gets stdin response
        exit
     }
  }
  
     ###################################
     # helper routines from utility.tcl
     ###################################
     # check for minimum release level
     check_library $libVersion
     
     # link to SmartBits chassis
     link_smb
  
     # check target cards
     check_card $iHub $iSlot $iPort $testedCards
     check_card $iHub2 $iSlot2 $iPort2 $testedCards
  
  #create a stream on card 1 and start capture on card 2
  1VLAN $iHub $iSlot $iPort
  
     # capture procedure from utility.tcl
     reset_capture $iHub2 $iSlot2 $iPort2
  
  # send a one second burst
  LIBCMD HTRun $HTRUN  $iHub $iSlot $iPort
  after 1000
  LIBCMD HTRun $HTSTOP  $iHub $iSlot $iPort
  
     # display_capture from utility.tcl
    display_capture $iHub2 $iSlot2 $iPort2
